package com.xiaoma.verbal.dao;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.xiaoma.verbal.baseDao.BaseDaoImpl;
import com.xiaoma.tpo.baseDao.DefaultRowMapper;
import com.xiaoma.verbal.domain.QuQuestion;
import com.xiaoma.verbal.domain.TagTable;
import com.xiaoma.verbal.dto.QuTagVo;

@Repository
public class TagTableDao extends BaseDaoImpl<TagTable> {
	private static final Logger LOG = LoggerFactory.getLogger(TagTableDao.class);

	public TagTable findByTypeAndText(Integer type,String text) {
		String sql = "SELECT * FROM tag_table where tag_type = ? and  tag_text = ?";
		LOG.info("SQL:{} PARAMS:{}", sql, text);
		List<?> result = jdbcTemplate.query(sql, new DefaultRowMapper(TagTable.class, getNameHandler()),type, text);
		if (result != null && result.size()>0) {
			return (TagTable) result.get(0);
		}
		return null;
	}
}
